package com.lg.demo.consumer;

import com.lg.distributed.transaction.message.listener.AbstractMessageListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.stereotype.Component;

/**
 * 继承 该抽象类，实则也是等同于 使用了 rabbitmqListener
 * <p>
 * 但是，相当于接受很热队列的 任何消息
 */
@Component
public class TransMessageListener extends AbstractMessageListener {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public void receiveMessage(Message message) {
        //int i = 1 / 0;
        logger.info(new String(message.getBody()));
    }

}